home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / plnk081.zip / pilot-link.0.8.1 / Java / Pdapilot / Block.java < prev    next >
Text File  |  1997-08-06  |  557b  |  38 lines

  1.  
  2. package Pdapilot;
  3.  
  4. import java.io.*;
  5.  
  6. /** A representation of a generic database block.
  7.  */
  8.  
  9. public class Block {
  10.         public byte[] raw;
  11.         
  12.         public Block() {
  13.             this.fill();
  14.         }
  15.         public Block(byte[] contents) {
  16.             this.unpack(contents);
  17.         }
  18.         
  19.         public void fill() {
  20.         }
  21.         
  22.         public byte[] pack() {
  23.             return raw;
  24.         }
  25.         
  26.         public void unpack(byte[] data) {
  27.             raw = data;
  28.         }
  29.         
  30.         public String describe() {
  31.             return "raw='" + Util.prettyPrint(raw);
  32.         }
  33.  
  34.     public String toString() {
  35.         return "<" + this.getClass().getName() + " " + describe() + ">";
  36.     }
  37. }
  38.